package com.chat.http.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.chat.dao.IPeopleDao;

@Service
public class PeopleService {
	
	@Autowired
	private IPeopleDao peopleDao;
	
	public String findById(int id){
		Map<String, String> map = peopleDao.findPeopleById(id);
		return map.get("name");
	}
	
	/**
	 * 判断用户是否存在
	 * @author zh_zhong
	 * @param userName
	 * @return
	 */
	public boolean isExist(String userName){
		return peopleDao.findModelByUserName(userName) == null ? false : true;
	}
	
}
